package pure.engine.status 
{
	import pure.engine.core.ITickListener;
	import pure.engine.core.ITickListener;
	import pure.engine.core.ProcessManager;
	import pure.engine.model.Entity;
	import pure.engine.core.ns_despair;

	use namespace ns_despair;
	/**
	 * @inheritDoc
	 * 
	 * 状态
	 * 
	 * @author ＃Pure
	 */
public class Status implements ITickListener
{
	
	
	public var m_entity:Entity;
	ns_despair var _ticked:Boolean, _framed:Boolean;
	
	
	
	public function setEntity(E:Entity):void
	{
		m_entity = E;
		//setTicked(true);
	}
	

	public function setTicked(flag:Boolean, priority:int = 0.0):void
	{
		if (_ticked != flag)
		{
			_ticked = flag;
			if(_ticked)
				ProcessManager.instance.addTickListener(this, ProcessManager.MOTION);
			else
				ProcessManager.instance.removeTickListener(this);
		}
	}



	public function update(elapsedT:Number):void
	{
	}
		
	
	public function dispose():void
	{
		setTicked(false);
		m_entity = null;
		
		_doDispose();
	}
	
	
	
	protected function _doDispose():void
	{
	}
}

}